package com.hwl.demo5.factory;

import com.hwl.demo1.service.Operation;
import com.hwl.demo5.service.IFactory;
import com.hwl.demo5.service.impl.Log;
import com.hwl.demo5.service.impl.Pow;

/**
 * 高级运算工厂
 *
 * @author sentry
 * @since 2023-03-18
 */
public class FactoryAdvanced implements IFactory {

    @Override
    public Operation createOperation(String operType) {
        switch (operType) {
            case "pow":
                return new Pow();
            case "log":
                return new Log();
            default:
                throw new RuntimeException("暂不支持该操作符");
        }
    }
}
